import torch
import torchvision.models as models

model = models.MNASNet(0.1)
for name,param in model.named_parameters():
    print(f"name:{name}")
    print(f"param:{param}")

torch.save(model.state_dict(),'model_weight.pth')
model.load_state_dict(torch.load('model_weight.pth',weights_only=True))

torch.save(model,'model.pth')
model = torch.load('model.pth',weights_only=False)